<template>
  <div>
    <!-- 顶部导航栏 -->
    <van-sticky :offset-top="0">
      <van-nav-bar
        title="意见反馈"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
      />
    </van-sticky>
    <van-field class="name" v-model="name" label="姓名" placeholder="邮箱/手机号/微信号" />
    <van-field
      v-model="value"
      label="联系方式"
      placeholder="邮箱/手机号/微信号"
    />

    <van-field
      class="top"
      v-model="message"
      rows="2"
      autosize
      label="留言"
      type="textarea"
      maxlength="50"
      placeholder="请输入留言"
      show-word-limit
    />
    <van-button @click="send" type="danger">提交</van-button>
  </div>
</template>

<script>
import { submit } from "@/api/my/index";
export default {
  components: {},

  data() {
    return {
      message: "",
      value: "",
      name: "",
    };
  },

  created() {},

  mounted() {},

  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    send() {
      submit({
        content: this.message,
        name: this.name,
        openId: localStorage.getItem("openId"),
        phone: this.value,
      }).then((res) => {
        console.log(res);
      });
    },
  },

  computed: {},

  watch: {},
};
</script>

<style scoped lang='less'>
.van-button {
  width: 335px;
  margin: 20px auto;
  border-radius: 6px;
}
.name{
    margin-top: 10px;
}
</style>